package com.woniuxy.reader.controller;


import com.woniuxy.reader.entity.Comment;
import com.woniuxy.reader.service.CommentService;
import com.woniuxy.result.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zh_o
 * @since 2020-10-12
 */
@RestController
@RequestMapping("/comment")
public class CommentController {

    @Autowired
    private CommentService commentService;

    /**
     * 新增评论
     * @param comment
     * @return
     */
    @PostMapping
    public Object insert(Comment comment) {
        commentService.save(comment);
        return ResponseResult.success();
    }

}

